<extend name="template/base_index" />

<block name="area_header">

	<link rel="stylesheet" href="__CSS__/buysell.css">
</block>

<block name="area_body">
	<div class="head">
		<a href="{:U('UserCenter/index')}"><i class="fa fa-chevron-left"></i></a>
		<span>我卖出的</span>
	</div>

	<volist name="sellinfo" id="sell">
		<div class="pro">
			<a href="{:U('Mybuysell/selldetail',array('order_code' => $sell['order_code']))}"><img src="{$sell['img']}" width="80px" height="80px"></a>
			<if condition="$sell['pay_status'] == 0">
				<ul>
					<li><span>{$sell['name']}</span></li>
					<li><p>&yen;{$sell['price']}</p></li>
					<li class="gray"><i class="fa fa-clock-o"></i>等待卖家付款</li>
				</ul>
			</if>
			<if condition="$sell['order_status'] == 3">
				<ul>
					<li><span>{$sell['name']}</span></li>
					<li><p>&yen;{$sell['price']}</p></li>
					<li class="gray"><i class="fa fa-clock-o"></i>等待卖家发货</li>
				</ul>
					<a href="{:U('Mybuysell/send_good',array('uid' => $sell['uid'],'order_code' => $sell['order_code']))}" class="pro-n-act weui_btn weui_btn_mini weui_btn_default">我要发货</a>
			</if>

		<if condition="$sell['order_status'] == 4">
			<ul>
				<li><span>{$sell['name']}</span></li>
				<li><p>&yen;{$sell['price']}</p></li>
				<li class="gray"><i class="fa fa-clock-o"></i>等待买家收货</li>
			</ul>
			<volist name="orderinfo" id="order">
				<if condition="$order['order_code'] eq $sell['order_code']">
					<a href="http://m.kuaidi100.com/index_all.html?type={$order['expresscode']}&postid={$order['expressno']}" class="pro-n-act weui_btn weui_btn_mini weui_btn_default">查看物流</a>
				</if>
			</volist>
		</if>
		<if condition="$sell['order_status'] == 5">
				<ul>
					<li><span>{$sell['name']}</span></li>
					<li><p>&yen;{$sell['price']}</p></li>
					<li class="gray"><i class="fa fa-check-circle"></i>交易成功</li>
				</ul>
			<volist name="orderinfo" id="order">
				<if condition="$order['order_code'] == $sell['order_code']">
					<a href="http://m.kuaidi100.com/index_all.html?type={$order['expresscode']}&postid={$order['expressno']}" class="pro-n-act weui_btn weui_btn_mini weui_btn_default">查看物流</a>
				</if>
			</volist>
		</if>
		<if condition="$sell['order_status'] == 8">
			<ul>
				<li><span>{$sell['name']}</span></li>
				<li><p>&yen;{$sell['price']}</p></li>
				<li class="gray"><i class="fa fa-close"></i>交易关闭</li >
			</ul>
			<volist name="refund" id="vo">
				<if condition="($vo['order_code'] eq $sell['order_code']) and ($vo['result'] eq 2)">
					<a data-href="{:U('Mybuysell/confirm_refund',array('order_code' => $vo['order_code']))}" class="sure-delete pro-n-act weui_btn weui_btn_mini weui_btn_default">确认买家订单取消</a>
				</if>
			</volist>
		</if>
		</div>
	</volist>

	<script src="__JS__/jquery-weui.min.js"></script>
	<script>
		/*确认收货*/
		$(function(){
			$(".sure-delete").bind("click", function() {
				var url = $(this).attr('data-href');
				$.confirm("您同意买家取消订单 系统将会把钱打到买家账户", function() {
					$.get(url,function(msg){
						if(msg){
							$.toast("确认成功");
							window.location.reload();
						}else{
							$.toast("不好意思 确认失败了");
						}
					});

				}, function() {
					//取消操作
				});
			});
		});
	</script>
</block>